Integrand size = 31, antiderivative size = 88 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {1}{2} a^2 (3 A+4 B) x+\frac {a^2 B \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 (3 A+2 B) \sin (c+d x)}{2 d}+\frac {A \cos (c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{2 d} \]
1/2*a^2*(3*A+4*B)*x+a^2*B*arctanh(sin(d*x+c))/d+1/2*a^2*(3*A+2*B)*sin(d*x+ c)/d+1/2*A*cos(d*x+c)*(a^2+a^2*sec(d*x+c))*sin(d*x+c)/d
Time = 0.48 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.09 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {a^2 \left (6 A d x+8 B d x-4 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 (2 A+B) \sin (c+d x)+A \sin (2 (c+d x))\right )}{4 d} \]
(a^2*(6*A*d*x + 8*B*d*x - 4*B*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 4 *B*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + 4*(2*A + B)*Sin[c + d*x] + A *Sin[2*(c + d*x)]))/(4*d)
Time = 0.44 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {3042, 4505, 3042, 4484, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos ^2(c+d x) (a \sec (c+d x)+a)^2 (A+B \sec (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^2 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 4505 |
\(\displaystyle \frac {1}{2} \int \cos (c+d x) (\sec (c+d x) a+a) (a (3 A+2 B)+2 a B \sec (c+d x))dx+\frac {A \sin (c+d x) \cos (c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \int \frac {\left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right ) \left (a (3 A+2 B)+2 a B \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {A \sin (c+d x) \cos (c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{2 d}\) |
\(\Big \downarrow \) 4484 |
\(\displaystyle \frac {1}{2} \left (\frac {a^2 (3 A+2 B) \sin (c+d x)}{d}-\int \left (-\left ((3 A+4 B) a^2\right )-2 B \sec (c+d x) a^2\right )dx\right )+\frac {A \sin (c+d x) \cos (c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{2 d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{2} \left (\frac {a^2 (3 A+2 B) \sin (c+d x)}{d}+a^2 x (3 A+4 B)+\frac {2 a^2 B \text {arctanh}(\sin (c+d x))}{d}\right )+\frac {A \sin (c+d x) \cos (c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{2 d}\) |
(A*Cos[c + d*x]*(a^2 + a^2*Sec[c + d*x])*Sin[c + d*x])/(2*d) + (a^2*(3*A + 4*B)*x + (2*a^2*B*ArcTanh[Sin[c + d*x]])/d + (a^2*(3*A + 2*B)*Sin[c + d*x ])/d)/2
3.1.58.3.1 Defintions of rubi rules used
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[A*a*Cot[e + f*x]*((d*Csc[e + f*x])^n/(f*n)), x] + Simp[1/(d*n) Int[(d*Csc[e + f*x])^( n + 1)*Simp[n*(B*a + A*b) + (B*b*n + A*a*(n + 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && LeQ[n, -1]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[a*A*Cot [e + f*x]*(a + b*Csc[e + f*x])^(m - 1)*((d*Csc[e + f*x])^n/(f*n)), x] - Sim p[b/(a*d*n) Int[(a + b*Csc[e + f*x])^(m - 1)*(d*Csc[e + f*x])^(n + 1)*Sim p[a*A*(m - n - 1) - b*B*n - (a*B*n + A*b*(m + n))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0 ] && GtQ[m, 1/2] && LtQ[n, -1]
Time = 0.70 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.83
method | result | size |
parallelrisch | \(\frac {3 \left (-\frac {2 B \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{3}+\frac {2 B \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{3}+\frac {A \sin \left (2 d x +2 c \right )}{6}+\frac {2 \left (2 A +B \right ) \sin \left (d x +c \right )}{3}+d \left (A +\frac {4 B}{3}\right ) x \right ) a^{2}}{2 d}\) | \(73\) |
derivativedivides | \(\frac {A \,a^{2} \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 A \,a^{2} \sin \left (d x +c \right )+2 B \,a^{2} \left (d x +c \right )+A \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{2} \sin \left (d x +c \right )}{d}\) | \(96\) |
default | \(\frac {A \,a^{2} \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 A \,a^{2} \sin \left (d x +c \right )+2 B \,a^{2} \left (d x +c \right )+A \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{2} \sin \left (d x +c \right )}{d}\) | \(96\) |
risch | \(\frac {3 a^{2} A x}{2}+2 a^{2} x B -\frac {i A \,a^{2} {\mathrm e}^{i \left (d x +c \right )}}{d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} B \,a^{2}}{2 d}+\frac {i A \,a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B \,a^{2}}{2 d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}+\frac {A \,a^{2} \sin \left (2 d x +2 c \right )}{4 d}\) | \(153\) |
norman | \(\frac {\left (\frac {3}{2} A \,a^{2}+2 B \,a^{2}\right ) x +\left (\frac {3}{2} A \,a^{2}+2 B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (-3 A \,a^{2}-4 B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {a^{2} \left (3 A +2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {a^{2} \left (5 A +2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {a^{2} \left (A +2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {a^{2} \left (7 A +2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}+\frac {B \,a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {B \,a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(240\) |
3/2*(-2/3*B*ln(tan(1/2*d*x+1/2*c)-1)+2/3*B*ln(tan(1/2*d*x+1/2*c)+1)+1/6*A* sin(2*d*x+2*c)+2/3*(2*A+B)*sin(d*x+c)+d*(A+4/3*B)*x)*a^2/d
Time = 0.29 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.90 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {{\left (3 \, A + 4 \, B\right )} a^{2} d x + B a^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - B a^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (A a^{2} \cos \left (d x + c\right ) + 2 \, {\left (2 \, A + B\right )} a^{2}\right )} \sin \left (d x + c\right )}{2 \, d} \]
1/2*((3*A + 4*B)*a^2*d*x + B*a^2*log(sin(d*x + c) + 1) - B*a^2*log(-sin(d* x + c) + 1) + (A*a^2*cos(d*x + c) + 2*(2*A + B)*a^2)*sin(d*x + c))/d
\[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=a^{2} \left (\int A \cos ^{2}{\left (c + d x \right )}\, dx + \int 2 A \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int A \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 2 B \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx\right ) \]
a**2*(Integral(A*cos(c + d*x)**2, x) + Integral(2*A*cos(c + d*x)**2*sec(c + d*x), x) + Integral(A*cos(c + d*x)**2*sec(c + d*x)**2, x) + Integral(B*c os(c + d*x)**2*sec(c + d*x), x) + Integral(2*B*cos(c + d*x)**2*sec(c + d*x )**2, x) + Integral(B*cos(c + d*x)**2*sec(c + d*x)**3, x))
Time = 0.23 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.15 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} + 4 \, {\left (d x + c\right )} A a^{2} + 8 \, {\left (d x + c\right )} B a^{2} + 2 \, B a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 8 \, A a^{2} \sin \left (d x + c\right ) + 4 \, B a^{2} \sin \left (d x + c\right )}{4 \, d} \]
1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*A*a^2 + 4*(d*x + c)*A*a^2 + 8*(d*x + c)*B*a^2 + 2*B*a^2*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 8*A* a^2*sin(d*x + c) + 4*B*a^2*sin(d*x + c))/d
Time = 0.31 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.65 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {2 \, B a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 2 \, B a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + {\left (3 \, A a^{2} + 4 \, B a^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (3 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 5 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]
1/2*(2*B*a^2*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 2*B*a^2*log(abs(tan(1/2* d*x + 1/2*c) - 1)) + (3*A*a^2 + 4*B*a^2)*(d*x + c) + 2*(3*A*a^2*tan(1/2*d* x + 1/2*c)^3 + 2*B*a^2*tan(1/2*d*x + 1/2*c)^3 + 5*A*a^2*tan(1/2*d*x + 1/2* c) + 2*B*a^2*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^2)/d
Time = 13.85 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.60 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {2\,A\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {3\,A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d} \]